SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [Live].[GetDistinctMarkitLoanIds] AS
BEGIN
SELECT DISTINCT i.[ExtId], [i].[InstrName]
FROM  [FSFundModel].[dbo].[Asset] a 
INNER JOIN [FSFundModel].[dbo].[Instrument] i ON [a].[InstrumentId] = [i].[InstrumentId]

WHERE  [i].[PricingVendor] = 'Markit Loans'
AND [a].[IsActiveEndOfDay] =1
AND [i].[ExtId] IS NOT NULL
AND LEFT([i].[ExtId],2) ='LX'
ORDER BY [i].[InstrName] ASC
END

GO
